﻿using System;
using System.Collections.Generic;
using System.Text;

namespace GeoFly
{
    /// <summary>
    /// 
    /// </summary>
    public class PETInDeBruin:PETInPM
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="tav"></param>
        /// <param name="elev"></param>
        /// <param name="yr"></param>
        /// <param name="dn"></param>
        /// <param name="lat">默认为33</param>
        public PETInDeBruin(double tav, double elev, int yr, int dn, double lat)
            : base(tav, elev, yr, dn, lat)
        {
            dTav = tav;
            dElev = dElev;
        }
        

        //1W=1J/s;
        //20W = 20*0.001*0.001*86400MJ/d = 1.728MJ/d
        /// <summary>
        /// 
        /// </summary>
        /// <param name="alfa">默认为0.95</param>
        /// <param name="beta">默认为1.728</param>
        /// <param name="G">默认为0</param>
        /// <returns></returns>
        public double PETByDeBruin(double alfa, double beta, double G)
        {
            double dret = 0;
            double dlta = pwatvap.TmpVapCurveSlp();		//slope of the saturation vapor pressure-temperature curve
            double gma = pwatvap.PsychroConst();			//psychrometric constant
            double dNetRad = NetRadiation();				//net radiation

            dret = alfa * dlta * (dNetRad - G) / (dlta + gma) + beta;
            return dret;
        }
        /// <summary>
        /// 同上，只是默认alfa=0.95,beta=1.728,G=0
        /// </summary>
        /// <returns></returns>
        public double PETByDeBruin()
        {
            return PETByDeBruin(0.95, 1.728, 0);

        }
    }
}

    
